package com.sky.controller.user;

import com.sky.entity.Category;
import com.sky.result.Result;
import com.sky.service.CategoryService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user/category")
@RequiredArgsConstructor
@Slf4j
public class UserCategoryController {

    private final CategoryService categoryService;

    @GetMapping("/list")
    public Result<?> categoryList(){
        List<Category> categoryList = categoryService.selectCategory();
        return Result.success(categoryList);
    }
}
